package com.glsc.ngateway.platform.service.easyflow.dto;

import com.glsc.ngateway.common.api.common.enums.DictConstant;
import com.glsc.ngateway.common.api.flowable.dto.param.DoTaskCommentDto;
import com.glsc.ngateway.common.api.flowable.dto.task.config.ProcessEditConfigDto;
import com.glsc.ngateway.common.api.flowable.resp.ResponseSituationDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Map;


/**
 * @author zzp
 * @date 2022/12/8
 * 流程任务通用TaskDto类
 */
@Data
public class FlowCommonTaskDto {
    /**
     * 草稿节点标识，如 createToTaskDefinitionKey="beginTask"，则创建流程后进入草稿状态
     */
    public static final String BEGIN_TASK = "beginTask";

    @ApiModelProperty(value = "流程标题")
    protected String processTitle;

    @ApiModelProperty(value = "流程实例ID")
    protected String processId;

    @ApiModelProperty(value = "任务ID")
    protected String taskId;

    @ApiModelProperty(value = "流程类型")
    protected String processDefineKey;

    @ApiModelProperty(value = "任务处理节点标识，必填，如applyTask，即流程定义文件中的：userTask id=applyTask")
    protected String taskDefinitionKey;

    @ApiModelProperty(value = "评论附言")
    protected DoTaskCommentDto commentDto;

    @ApiModelProperty(value = "流程处理模式VIEW/EDIT，字典：am_flowable_handle_mode, VIEW/EDIT")
    protected String handleProcessMode = DictConstant.FLOWABLE_HANDLE_MODE_VIEW;

    @ApiModelProperty(value = "流程是否结束")
    protected String processEnd = "0";

//    @ApiModelProperty(value = "流程基础信息")
//    protected FlowableProcessInfo flowableProcessInfo = new FlowableProcessInfo();

    @ApiModelProperty(value = "流程节点可编辑字段、退回等信息")
    protected ProcessEditConfigDto processEditConfigDto = new ProcessEditConfigDto();

    @ApiModelProperty(value = "进入草稿节点标识，如进入草稿此字段赋值常量beginTask")
    private String createToTaskDefinitionKey;

    @ApiModelProperty(value = "回退至指定任务节点")
    protected String rollbackToTaskDefineKey;

    /**
     * 解决任务前后处理
     */
    @ApiModelProperty(value = "当前节点状态信息")
    protected ResponseSituationDto currentTaskInfo = new ResponseSituationDto();

    @ApiModelProperty(value = "流程在审核、退回等处理前的流程信息，主要是任务信息")
    protected ResponseSituationDto beforeAuditFlowInfo;

    @ApiModelProperty(value = "流程在审核、退回等处理后的流程信息，主要是任务信息")
    protected ResponseSituationDto afterAuditFlowInfo;

    @ApiModelProperty(value = "【流程节点处理人】，动态指定节点处理人，个性化处理，配置已经通用处理")
    protected Map<String, String> taskAssignee;

    @ApiModelProperty(value = "【流程节点变量】个性化处理，配置已经通用处理")
    protected Map<String, String> conditionalVariable;

    @ApiModelProperty(value = "任务当前操作人")
    protected String operatorAccount;
}
